package fr.inserm.umr915.vcfannotator.bio;

import java.util.Map;
import java.util.TreeMap;

import fr.inserm.umr915.vcfannotator.lang.AbstractCharSeq;

public class MutatedSequence extends AbstractCharSeq
	{
	private CharSequence wild;
	private Map<Integer, Character> pos2char=new TreeMap<Integer, Character>();
	public MutatedSequence(CharSequence wild)
		{
		this.wild=wild;
		}
	
	public void put(int pos,char c)
		{
		this.pos2char.put(pos, c);
		}
	
	@Override
	public char charAt(int i)
		{
		Character c= pos2char.get(i);
		return c==null?wild.charAt(i):c;
		}
	
	@Override
	public int length()
		{
		return this.wild.length();
		}
	}
